<HTML><HEAD><TITLE>fcompile(++File, ++Options)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(fcompile)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>fcompile(++File, ++Options)</H1>
Generates an object file from the ECLiPSe source File with specified options.
<DL>
<DT><EM>File</EM></DT>
<DD>Name of source file (Atom or string)
</DD>
<DT><EM>Options</EM></DT>
<DD>List of valid options and their values
</DD>
</DL>
<H2>Description</H2>
<P>
   This predicate is obsolete, use compile/2 instead.
</P><P>
   Compiles the specified Prolog source file and generates an object file
   with the same base name as the source file but with suffix <TT>.eco</TT>.
   Object files can be loaded by the built-in predicates <TT>use_module/1</TT>,
   <TT>lib/1</TT>, <TT>compile/1</TT> and <TT>ensure_loaded/1</TT>, and also
   with the eclipse -b command-line option.
</P><P>
   File must be instantiated to a legitimate specification for an existing
   file except for the suffix, which may be omitted. Options is a list of
   Option:Value pairs where Option and value can be:
</P>
<DL>
   <DT>compile: YesOrNo

       <DD> YesOrNo is either the  atom yes or no. For 'yes', fcompile will
       try to first compile File (checking that it has not already been
       compiled first).  This is usually what is required, as it ensures
       that File can be properly read to generate the object file. The
       default is 'yes'.

   <DT>format: ByteOrText

      <DD>ByteOrText is either the atom <TT>byte</TT> or <TT>text</TT>.  If 'text', the
      object file will be in a textual format.  If 'byte', the object file
      will be in a binary format which is larger, but will load faster
      and is not human readable. The default is byte.

   <DT>outdir: OutputDirectory

       <DD> OutputDirectory is the directory where the generated object
       file will be placed. It can be an atom or a string. The default is
       the current working directory.

   <DT>verbose: YesOrNo

       <DD> YesOrNo is either the  atom yes or no. For 'yes', fcompile will
       report in detail the predicates it is dumping out. This is probably
       only needed for debugging fcompile, to trace its progress. The default
       is 'no'.
</DL><P>
   The predicate will look for File with a `source' suffix (i.e. no
   suffix, <TT>.ecl</TT> or <TT>.pl</TT>), compile the file by calling compile, and
   generate an object form of the source file with suffix <TT>.eco</TT>.
   The user should use <TT>include/1</TT> directives to include all files that are
   in the same module as the master file, and <TT>use_module/1</TT> directives for
   files that define a different module. Files mentioned in include
   directives will not need to be fcompiled separately for their object
   form.
</P><P>
   This object form can be loaded into an ECLiPSe session even on a
   different operating system/hardware platform from the one on which
   it was generated.  However, the object format may change incompatibly
   between different releases of ECLiPSe.
</P><P>
   The fcompile library does not need to be loaded in order to load the object
   file.  The built-in predicates <TT>ensure_loaded/1</TT>, <TT>use_module/1</TT>
   and <TT>lib/1,2</TT> will try to load an object file in preference to a
   source file, if both are present.  The compile built-ins on the
   other hand will prefer source files, unless the <TT>.eco</TT>
   suffix is explicitly given.
</P><P>
   It is recommended that object files always contain proper modules.
   If an object file contains module-free code, then loading it into
   an existing module that already has code can cause conflicts with
   auxiliary predicates (e.g. from <TT>do/2</TT> loop constructs).
</P><P>
   <EM>Restrictions:</EM>
<UL>
     <LI>macro definitions should be quoted using 
     <TT>no_macro_expansion/1</TT>, e.g.
     <PRE>
         :- local macro(no_macro_expansion(maxint), 9999).
     </PRE>

     <LI>directives in the module should not change the state 
         of compiled code.

     <LI>big integer constants between -2^63 and -2^31 and between
     	2^31 and 2^63 should not appear directly in the source, and
	will provoke a warning because the generated object code will
	not be portable between 32 and 64 bit machines.
</UL>
</P>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H2>Examples</H2>
<PRE>   fcompile(my_prog, []).   % equivalent to fcompile(my_prog)

   fcompile(my_prog, [format:text, outdir:'../']).
   % generate the object file in text format, and place it in the parent dir
</PRE>
<H2>See Also</H2>
<A HREF="../../lib/fcompile/fcompile-1.html">fcompile / 1</A>
</BODY></HTML>
